<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../css/public.css" media="all">
</head>
<body>
<div class="layuimini-container">
   <div class="layuimini-main">
      <fieldset class="table-search-fieldset">
        <legend>多条件搜索</legend>
         <div class="layui-form layui-form-pane" lay-filter="orderForm">
           <div class="layui-form-item">
                <label class="layui-form-label required">商品名称</label>
                <div class="layui-input-block">
                   <input id="goodsName" type="text" name="goodsName" placeholder="请输入商品名称" value="" class="layui-input">           
                </div>
         </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">尺寸</label>
        <div id="standard" class="layui-input-block">
            <input type="checkbox" name="standard1" value="小" title="小">
            <input type="checkbox" name="standard2" value="中" title="中">
            <input type="checkbox" name="standard3" value="大" title="大">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">材质</label>
        <div id="material" class="layui-input-block">
            <input type="checkbox" name="material1" value="硅胶" title="硅胶">
            <input type="checkbox" name="material2" value="油泥" title="油泥">
            <input type="checkbox" name="material3" value="黏土" title="黏土">
            <input type="checkbox" name="material4" value="PVC" title="PVC">
        </div>
    </div>
    
    <div class="layui-form-item">
      <label class="layui-form-label">出/入库</label>
       <div id="status" class="layui-input-block">
         <input type="checkbox" name="status1" value="in"   title="入库单据" checked>
         <input type="checkbox" name="status2"  value="out" title="出库单据" checked>
       </div>
    </div>
    
    <div class="layui-form-item">
       <label class="layui-form-label" style="margin-right:9px">起始时间</label>
       <div class="layui-input-block" style="margin: 5px">
         <input type="date" name= "start" class="layui-date layui-btn layui-btn-primary" >  
         <input type="date" name= "end"   class="layui-date layui-btn layui-btn-primary" >  
          <tip>比较规则：2020-11-23 00:00:00 - 2020-11-26 00:00:00 (包含启始时间)</tip>
       </div>
    </div>
    <div class="layui-form-item">     
       <button id='sumbtn' type="button" class="layui-btn layui-btn-sm "  lay-submit lay-filter="data-search-btn"><i class="layui-icon"></i> 
       统计</button>       
    </div>
</div>
</fieldset>
  <div class="layui-inline" style = "margin-top:8px">
     <button id="resetTable" type="button" class="layui-btn layui-btn-sm layui-btn-warm">重置表格</button>
  </div>
  <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
  </div>
</div>
<script src="../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>

<script>
    // location.reload();
    layui.use(['form', 'table' ,'layer' ], function () {



        var $ = layui.jquery,
            form = layui.form,
            table = layui.table;
          $('#sumbtn').on('click',function(){
        	  var data = form.val('orderForm');
        	  console.log(data);
        	  table.render({
                  elem: '#currentTableId',
                  url:  '/orders?action=selectSumList',
                  where: data,
                  cols: [[
                	  {field: 'goodsNo', width: 180, title: '商品类编号' ,sort: true},
                	  {field: 'goodsName', width: 180, title: '商品名称' },
                	  {field: 'standard', width: 80, title: '尺寸'},
                	  {field: 'material', width: 80, title: '材质'},   
                      {field: 'sum', title: '出/入数量总计', width:150 },
                      {field: 'status', width: 100, title: '出/入库', sort:true},
                  ]],                                    
                  page: true,
                  limit: 5,
                  limits:  [5,10, 15, 20, 25, 50, 100],
              });  	
        });
          $('#resetTable').on('click',function(){
        	  var data = form.val('orderForm');
        	  console.log(data);
        	  table.render({
                  elem: '#currentTableId',
                  url:  '/orders?action=selectSumList',
                  cols: [[
                	  {field: 'goodsNo', width: 180, title: '商品类编号' ,sort: true},
                	  {field: 'goodsName', width: 180, title: '商品名称' },
                	  {field: 'standard', width: 80, title: '尺寸'},
                	  {field: 'material', width: 80, title: '材质'},   
                      {field: 'sum', title: '出/入数量总计', width:150 },
                      {field: 'status', width: 100, title: '出/入库', sort:true},
                  ]],                                    
                  page: true,
                  limit: 10,
                  limits:  [5,10, 15, 20, 25, 50, 100],
              });  	
        }).click();  
    });    
</script>
</body>
</html>

